/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "album_detail", catalog = "OnlineShopFourDVD", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "AlbumDetail.findAll", query = "SELECT a FROM AlbumDetail a"),
    @NamedQuery(name = "AlbumDetail.findByDetailId", query = "SELECT a FROM AlbumDetail a WHERE a.detailId = :detailId"),
    @NamedQuery(name = "AlbumDetail.findByMediaId", query = "SELECT a FROM AlbumDetail a WHERE a.mediaId = :mediaId")})
public class AlbumDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "detail_id", nullable = false)
    private Integer detailId;
    @Column(name = "media_id")
    private Integer mediaId;
    @JoinColumn(name = "album_id", referencedColumnName = "album_id")
    @ManyToOne
    private Album album;

    public AlbumDetail() {
    }

    public AlbumDetail(Integer detailId) {
        this.detailId = detailId;
    }

    public Integer getDetailId() {
        return detailId;
    }

    public void setDetailId(Integer detailId) {
        this.detailId = detailId;
    }

    public Integer getMediaId() {
        return mediaId;
    }

    public void setMediaId(Integer mediaId) {
        this.mediaId = mediaId;
    }

    public Album getAlbum() {
        return album;
    }

    public void setAlbum(Album album) {
        this.album = album;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (detailId != null ? detailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AlbumDetail)) {
            return false;
        }
        AlbumDetail other = (AlbumDetail) object;
        if ((this.detailId == null && other.detailId != null) || (this.detailId != null && !this.detailId.equals(other.detailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.AlbumDetail[detailId=" + detailId + "]";
    }

}
